package com.example.demo.leetcode.classics150;

/**
 * ******************************************************
 *
 * @author liugh9
 * @version 1.0
 * @classname _131回文数
 * @description
 * @date 2023/08/23 17:14
 * <p>
 * ******************************************************
 */
public class _131回文数 {

    public static boolean isPalindrome(int x) {
        if (x < 0) {
            return false;
        }
        StringBuilder item = new StringBuilder().append(x);
        String curr = item.toString();
        StringBuilder reverse = item.reverse();
        return curr.equals(reverse.toString());
    }

    public static void main(String[] args) {
        System.out.println(isPalindrome(10));
    }
}
